#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)
#define endl '\n'
const int N = 10105;
const int MX = 10100;

int a[N], b[N], c[N];

bool cmp(string& s, string& t) {
  if (s.size() != t.size()) return s.size() < t.size();
  return s < t;
}
void init(string& s, int a[N]) {
  for (int i = 0, j = s.size() - 1; i < s.size(); i++, j--) a[i] = s[j] - '0';
}

void substract(int a[N], int b[N], int c[N]) {
  int carry = 0;
  rep(i, 0, MX) {
    c[i] = a[i] - b[i];
    if (c[i] < 0) c[i] += 10, a[i + 1]--;
  }
}
void output(int a[N]) {
  int h = MX;
  while (h > 0 && !a[h]) h--;
  per(i, h, 0) cout << a[i];
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  string s, t;
  cin >> s >> t;
  bool neg = cmp(s, t);
  if (neg) swap(s, t), cout << '-';
  init(s, a);
  init(t, b);
  substract(a, b, c);
  output(c);
  return 0;
}